<?php

class testCR extends CI_Controller
{

    function __construct()
    {
        parent::__construct();
    }

    function test()
    {
        $skuMap = array('15h33800-0078', '15h34000-0080', '15h34100-0078', '06010000-0144', '15h34300-0415', '06010000-0146', '15h38600-0022', '15h38600-0023', '15h38700-0009', '06010000-0145', '06010000-0147', '06010000-0148', '15h38700-0010', '06010000-0151', '06010000-0152', '06010000-0149', '06010000-0150', '15h38800-0017', '15h38800-0018', '06010000-0137', '15h39500-0236', '15h3c900-0053', '06010000-0138', '06010000-0139', '06010000-0136', '01010000-6481', '01010000-6482', '01010000-6483', '01010000-6484', '15h3d300-0009', '10010100-0072', '10010100-0073', '10010100-0074', '10010100-0075', '15h34500-0183', '15h3c400-0008', '15h3c900-0054', '10010100-0076', '10010100-0077', '15h34300-0416', '15h3c900-0055', '07010000-0128', '07010000-0129', '07010000-0130', '15h38200-0020', '06010000-0153', '18n10000-0001', '18n10000-0002', '18n10000-0003', '18n10000-0004', '06010000-0154', '06010000-0155', '06010000-0156', '12010000-0334', '12010000-0336', '12010000-0335', '19010000-0186', '16010000-4035', '15h30300-0291', '15h30500-0507', '15h30700-0943', '15h34000-0081', '15h34100-0079', '15h38200-0019', '15h39100-0012', '15h3d500-0001', '15h30100-0099', '15h30200-0373', '15h30300-0292', '15h30400-0293', '15h30400-0294', '15h30500-0508', '15h30500-0509', '15h30600-0457', '15h30600-0458', '15h30700-0944', '15h30700-0945', '15h30700-0946', '15h31000-0360', '15h31000-0361', '15h31200-0648', '15h31200-0649', '15h31300-0747', '15h31300-0748', '15h31400-0197', '15h31500-0235', '15h31500-0236', '05020000-0013', '15h31600-0483', '15h31600-0484', '15h31700-0534', '15h31700-0535', '05020000-0014', '15h32400-0020', '15h32400-0021', '15h32400-0022', '15h33800-0079', '15h33800-0080', '15h34300-0417', '15h34300-0418', '15h34500-0184', '15h38700-0011', '15h39000-0010', '15h3c900-0056', '15h3c900-0057', '15h3c900-0058', '15h3c900-0059', '15h3d200-0004', '15h30100-0100', '15h30200-0374', '15h30300-0293', '15h30300-0294', '15h30400-0295', '15h30600-0459', '15h31000-0362', '15h31200-0650', '15h31300-0749', '15h31600-0485', '15h31700-0536', '15h32400-0023', '15h33400-0053', '15h33800-0081', '15h34000-0082', '15h34100-0080', '15h34200-0044', '15h34300-0419', '15h34300-0420', '15h35200-0004', '15h35300-0004', '15h38700-0012', '15h38800-0019', '15h3d500-0002', '15h3d600-0001', '15h39400-0003', '15h3d300-0006', '15h41400-0026', '15h30700-0939', '15h52600-0002', '15h52700-0002', '15h33700-0025', '15h3c300-0005', '15h3c900-0047', '15h32800-0106', '15h30500-0499', '15h3c400-0006', '15h30500-0500', '15h3c300-0006', '15h30400-0290', '15h3c900-0050', '15h30500-0501', '15h3c900-0048', '15h3c900-0049', '15h3c400-0007', '15h30700-0940', '15h31400-0195', '15h31200-0646', '15h31700-0531', '02023500-0001', '15h3d300-0007', '15h30700-0934', '15h30700-0935', '15h30700-0936', '15h3c900-0043', '15h3c400-0005', '15h3c900-0044', '02023500-0003', '15h3c900-0045', '02023500-0002', '15h50500-0003', '15h32600-0006', '15h3c900-0046', '15h34100-0074', '15h38200-0016', '15h30700-0937', '15h3d400-0003', '15h30700-0938', '15h31600-0480', '02023600-0002', '15h31200-0645', '07010000-0131', '07010000-0132', '07010000-0133', '02023600-0003', '07010000-0134', '02023600-0001', '12010000-0337', '02023700-0001', '02023700-0002', '01010000-6485', '01010000-6486', '15n24500-0001', '15h31700-0537', '15h3c900-0060', '15h30700-0947', '15h3d300-0010', '07010000-0135', '07010000-0136', '07010000-0137', '15h30200-0375', '15h30200-0376', '15h30400-0296', '15h30500-0510', '07010000-0140', '15h30700-0948', '15h31000-0363', '15h31200-0651', '15h31300-0750', '15h31500-0237', '07010000-0138', '15h31600-0486', '15h31700-0538', '07010000-0139', '15h32400-0024', '07010000-0141', '15h33400-0054', '15h33400-0055', '07010000-0142', '15h33700-0027', '15h33800-0082', '15h34000-0083', '15h34000-0084', '15h34100-0081', '15h34100-0082', '15h34300-0421', '15h35300-0005', '15h35300-0006', '15h36200-0007', '07010000-0143', '15h38600-0024', '15h38700-0013', '15h39100-0013', '15h39100-0014', '07010000-0144', '15h3c900-0061', '07010000-0145', '07010000-0146', '17010000-0162', '15h3c900-0062', '11010000-0539', '02100211-0002', '11010000-0540', '02020011-0004', '11010000-0541', '02041511-0006', '02160811-0002', '02052511-0002', '11010000-0542', '11010000-0543', '11010000-0544', '11010000-0545', '11010000-0546', '11010000-0547', '11010000-0548', '11010000-0549', '11010000-0550', '11010000-0551', '11010000-0552', '07010000-0148', '11010000-0553', '11010000-0554', '11010000-0555', '07010000-0147', '11010000-0556', '07010000-0149', '07010000-0150', '12010000-0338', '12010000-0339', '07010000-0151', '07010000-0152', '18m40100-0001', '18m40100-0002', '11010000-0557', '11010000-0560', '11010000-0558', '11010000-0559', '11010000-0561', '11010000-0563', '11010000-0562', '11010000-0564', '11010000-0566', '11010000-0565', '05010000-0074', '05010000-0075', '12010000-0340', '16010000-4036', '11010000-0567', '11010000-0569', '11010000-0568', '11010000-0570', '18010000-0855', '11010000-0571', '15h30500-0511', '10010100-0078', '11010000-0572', '11010000-0573', '15h34500-0185', '18010000-0856', '11010000-0574', '11010000-0575', '11010000-0576', '18010000-0857', '11010000-0578', '11010000-0577', '15h3c500-0002', '15h3c500-0003', '18010000-0858', '18010000-0859', '18010000-0860', '18010000-0861', '18010000-0862', '18010000-0863', '11010000-0579', '11010000-0581', '11010000-0580', '11010000-0582', '11010000-0583', '11010000-0584', '17010000-0163', '17010000-0164', '17010000-0165', '01010000-6487', '01010000-6488', '10011800-0001', '11010000-0585', '11n50000-0001', '11n50000-0002', '11n60000-0001', '11n60000-0002', '11n60000-0003', '11n60000-0004', '11n60000-0005', '11n60000-0006', '11n60000-0007', '11n60000-0008', '11n60000-0009', '11010000-0586', '17010000-0166', '17010000-0167', '17010000-0168', '17010000-0169', '17010000-0170', '17010000-0171', '17010000-0172', '17010000-0173', '17010000-0174', '17010000-0175', '15h33900-0012', '15h30700-0949', '15h30700-0950', '15h31700-0539', '15h31700-0540', '15h31700-0541', '15h30700-0952', '15h30700-0953', '15h30700-0955', '15h30700-0954', '15h31700-0542', '15h30700-0951', '03220000-0001', '01010000-6490', '01010000-6491', '01010000-6492', '01010000-6489', '17010000-0176', '17010000-0177', '17010000-0178', '17010000-0180', '17010000-0179', '15h30700-0957', '15h30500-0512', '15h38200-0021', '15h30700-0956', '15h38500-0016', '15h38200-0022', '15h30600-0460', '15h3c300-0007', '15h3a200-0003', '15h3a200-0004', '15l60300-0001', '15l60200-0001', '15l60100-0002', '15l60100-0001', '15m45100-0001', '15m41200-0002', '15m41100-0002', '15m41000-0002', '15m4b200-0002', '15m40300-0002', '15m40200-0002', '15m41300-0001', '08010000-0410', '08010000-0409', '08010000-0413', '08010000-0412', '08010000-0411', '15m40400-0002', '15m41500-0002', '15m41400-0001', '15m40700-0002', '15m40900-0002', '15m41500-0003', '15m41600-0001', '15m42100-0001', '15m42100-0002', '15m40200-0001', '15m40300-0001', '15m40400-0001', '15m40500-0001', '15m40600-0001', '15m41200-0001', '15m40900-0001', '15m4b200-0001', '15m40700-0001', '15m41000-0001', '15m41500-0001', '15m41100-0001', '08010000-0414', '15h3c900-0063', '02010011-0004', '16010011-1960', '02010011-0008', '02a40011-0004', '02180112-0001', '16010012-0017', '02351812-0001', '02010012-0069', '17010000-0181', '02120212-0002', '02090512-0002', '02100412-0003', '02020411-0009', '02020411-0008', '02130411-0018', '02990012-0001', '08010000-0415', '08010000-0416', '08010000-0417', '08010000-0420', '08010000-0418', '08010000-0419', '07010000-0153', '08010000-0421', '08010000-0422', '08010000-0423', '08010000-0425', '08010000-0424', '08010000-0426', '08010000-0427', '08010000-0428', '08010000-0429', '19010000-0187', '08010000-0430', '08010000-0431', '08010000-0432', '13n91200-0001', '13n91300-0001', '13n91400-0001', '13n91500-0001', '15h38900-0004', '15h38900-0005', '15h38900-0003', '19l91200-0001', '13l80500-0001', '13l80700-0001', '01018900-0007', '13n91000-0001', '13n90800-0001', '13n91100-0001', '13n90900-0001', '13n90700-0001', '13n90600-0001', '13n90500-0001', '13n90400-0001', '13n90300-0001', '13n90200-0001', '13n90000-0001', '13n90100-0001', '13l81100-0001', '13l81000-0001', '13l80900-0001', '13l80600-0001', '13l80800-0001', '19l91100-0001', '18n80000-0001', '01018900-0016', '01018900-0013', '01018900-0012', '01018900-0008', '01018900-0009', '01018900-0010', '01018900-0011', '01018900-0014', '01018900-0015', '02800000-0005', '02021500-0011', '02811200-0001', '02n70000-0001', '02d20000-0002', '01018900-0001', '01018900-0002', '01018900-0003', '01018900-0005', '01018900-0004', '01018900-0006', '16p00000-0001', '16p00000-0002', '15h40000-0040', '15h40000-0041', '07020000-0014', '07020000-0015', '16p00000-0003', '02800900-0001', '02800600-0001', '02b40000-0007', '02020011-0001', '12010011-0106', '02021211-0004', '02020611-0004', '02020611-0002', '15h30200-0377', '15h3a200-0005', '15h30700-0959', '02171100-0001', '02171100-0002', '02171100-0003', '02171000-0001', '02171000-0002', '15h31700-0543', '15h30500-0516', '02810000-0008', '05010000-0076', '05010000-0077', '02811300-0001', '01018900-0017', '15h33700-0030', '15h33700-0029', '15h41000-0029', '15h33700-0028', '16010000-4037', '16010000-4038', '16010000-4040', '16010000-4039', '15h3a200-0007', '15h31300-0751', '15h31200-0652', '19010000-0188', '19010000-0189', '15h30700-0958', '08010000-0433', '16010000-4041', '16010000-4042', '16010000-4043', '16010000-4044', '16010000-4046', '16010000-4045', '15h34500-0186', '15h30400-0297', '15h38200-0023', '15h3d300-0012', '18010000-0868', '18010000-0864', '18010000-0865', '17n80000-0001', '17p10100-0001', '17p10000-0001', '17p10200-0001', '15h30700-0960', '15h31700-0544', '15h3a200-0006', '15h3d300-0011', '01018900-0024', '01018900-0018', '01018900-0025', '01018900-0020', '01018900-0019', '01018900-0022', '01018900-0021', '01018900-0023', '01018900-0026', '12010000-0341', '12010000-0343', '12010000-0342', '12010000-0344', '12010000-0345', '12010000-0347', '12010000-0348', '12010000-0349', '12010000-0346', '12010000-0350', '11010000-0589', '11010000-0587', '11010000-0588', '18010000-0870', '18010000-0871', '18010000-0872', '11010000-0592', '11010000-0590', '11010000-0591', '11010000-0593', '19010000-0190', '01010000-6493', '15h30500-0514', '18010000-0873', '18010000-0874', '18010000-0875', '18010000-0876', '18010000-0877', '18010000-0878', '18010000-0879', '18010000-0880', '18010000-0881', '18010000-0882', '15h3c300-0008', '15h3a200-0009', '15h3a200-0008', '15h35300-0007', '15h30700-0963', '15h3c900-0065', '15h35300-0008', '15h3c900-0064', '15h30500-0517', '15h30500-0465', '18010000-0884', '18010000-0883', '18010000-0885', '18010000-0886', '18010000-0887', '13m91300-0001', '13m91200-0001', '03223400-0001', '13m91400-0001', '13p21000-0001', '13p20700-0001', '13p20600-0001', '13p20900-0001', '13p20800-0001', '13p20400-0001', '13p20500-0001', '15h30400-0298', '13p20300-0001', '13p20200-0001', '13p20100-0001', '13p20000-0001', '15h34500-0187', '15h38900-0007', '15h3d500-0005', '15h3d500-0004', '15h39100-0019', '15h39100-0018', '15h34100-0086', '15h34100-0085', '15h30700-0962', '15h34000-0088', '15h34000-0087', '15h30300-0298', '15h30300-0297', '15h33400-0057', '18010000-0869', '15h38900-0006', '15h30900-0014', '15h30100-0102', '15h30300-0296', '15h30100-0103', '15h30200-0379', '15h30300-0295', '15h34000-0086', '15h34100-0084', '15h39100-0017', '15h30500-0513', '15h30500-0515', '15h30100-0101', '15h30200-0378', '15h30700-0961', '15h33400-0056', '15h34000-0085', '15h3d500-0003', '15h39100-0016', '15h39100-0015', '15h34100-0083', '15h33700-0031', '15h36200-0008', '01010000-6494', '18010000-0890', '18010000-0888', '18010000-0889', '15h3c900-0067', '15h3c900-0066', '02440600-0018', '02440600-0008', '02440600-0017', '02440600-0016', '02440600-0015', '02440600-0014', '02440600-0009', '02440600-0013', '02440600-0011', '02440600-0012', '02440600-0010', '02440600-0007', '19010000-0191', '19010000-0192', '18010000-0891', '19010000-0193', '19010000-0194', '15h40500-0027', '15h40800-0016', '15h41800-0013', '15h41000-0030', '15h41400-0027', '11010000-0594', '15h40100-0001', '15h40200-0001', '15h40500-0028', '15h40800-0017', '15h41800-0014', '15h41400-0028', '15h40200-0002', '15h40100-0002', '15h41000-0031', '18010000-0892', '18010000-0893', '18010000-0894', '18010000-0895', '18010000-0896', '19010000-0195', '13m91500-0001', '13m91600-0001', '13m91700-0001', '13m92200-0001', '13m91900-0001', '13m91800-0001', '13m92100-0001', '13m92000-0001', '18010000-0897', '18010000-0899', '18010000-0898', '18010000-0900', '18010000-0901', '17010000-0182', '18010000-0902', '18010000-0903', '18010000-0904', '18010000-0905', '18010000-0906', '19010000-0196', '15h5c900-0001', '15h30700-0964', '15h3c900-0068', '15h31600-0487', '15h32600-0008', '15h3d300-0013', '15h30500-0518', '01010000-6495', '03223500-0001', '15h30600-0461', '15h38800-0020', '15h32400-0025', '15h38600-0025', '15p40000-0008', '15p40000-0002', '15p40000-0001', '15p40000-0004', '15p40000-0003', '15p40000-0006', '15p40000-0007', '15p40000-0005', '18010000-0907', '18010000-0909', '18010000-0908', '18010000-0910', '18010000-0911', '18010000-0913', '18010000-0912', '18010000-0914', '18010000-0916', '18010000-0915', '18010000-0917', '19010000-0197', '08010000-0434', '19010000-0198', '13p77400-0001', '13p77300-0001', '13p77300-0002', '11010000-0595', '13p70000-0001', '13n97100-0001', '13n96300-0001', '13n96600-0001', '11010000-0596', '13n96700-0001', '13n96400-0001', '11010000-0597', '13n96800-0001', '11010000-0598', '13n97200-0001', '13n94900-0001', '13p60500-0001', '11010000-0599', '02d20400-0003', '02057400-0001', '11010000-0600', '02811200-0002', '11010000-0601', '12p50000-0001', '13p60000-0001', '13p60100-0001', '11010000-0602', '11010000-0604', '11010000-0603', '15p91300-0001', '13n97000-0001', '13n91900-0001', '11010000-0606', '11010000-0605', '11010000-0607', '11010000-0608', '11010000-0609', '11010000-0611', '11010000-0610', '11010000-0612', '11010000-0613', '06010000-0158', '06010000-0159', '06010000-0160', '12010000-0353', '13n96900-0001', '13n96500-0001', '13p60400-0001', '13p60200-0001', '13p60300-0001', '13p60600-0001', '13p61000-0001', '13p60700-0001', '13p60800-0001', '13p60900-0001', '13p61100-0001', '13n94600-0001', '13n96200-0001', '13n94700-0001', '13n96100-0001', '13n96000-0001', '13n94800-0001', '13n95000-0001', '13n95300-0001', '13p61200-0001', '13n95700-0001', '13n95600-0001', '13n95800-0001', '13n95500-0001', '13n95900-0001', '19010000-0199', '19010000-0200', '13n95400-0001', '13n91800-0001', '13n91700-0001', '19010000-0202', '13n91600-0001', '13n92000-0001', '19010000-0201', '13n92300-0001', '13n95200-0001', '13n95100-0001', '13n94500-0001', '13n93200-0001', '13n94200-0001', '13n94300-0001', '13n94000-0001', '13n93800-0001', '13n93900-0001', '13n92100-0001', '13n94400-0001', '13n94100-0001', '15p80000-0003', '15p80000-0001', '15p80000-0002', '13n92200-0001', '13n93400-0001', '13n93300-0001', '13n93100-0002', '13n93100-0001', '13n92500-0001', '13n93500-0001', '13n92700-0001', '13n92600-0001', '13n92800-0001', '13n92900-0001', '13n92400-0001', '01010000-6496', '02811200-0003', '02201000-0004', '02201700-0001', '02201700-0002', '02201700-0003', '15i90300-0038', '17010000-0184', '17010000-0183', '17010000-0185', '16010000-4048', '16010000-4049', '05010000-0078', '05010000-0079', '15i96600-0003', '15i96600-0004', '15i92300-0001', '15i92300-0002', '15i92300-0003', '19010000-0203', '15i92300-0004', '15i96600-0002', '15i96600-0001', '15i92300-0005', '15i92300-0006');

        $ls = rand(1, 10);
        $lstProduct = array();
        for ($i = 0; $i < $ls; $i++)
        {
            $lstProduct[] = array(
                'sku' => $skuMap[rand(0, 800)],
                'quantity' => rand(1, 10),
            );
        }
        $data = array(
            'whs_code' => 'S001-W1',
            'creator_id' => '测试API',
            'order_id' => '单号' . rand(1000000, 9999999),
            'lstProduct' => $lstProduct
        );
        

        $url = "http://127.0.0.1:8069/sc/wms/CreateReceivingOrder/create_receiving_order";
        $data_string=json_encode($data);
        $expression=$this->http_post_data($url, $data_string);
        var_dump($expression);
    }
       function http_post_data($url, $data_string) {  
  
        $ch = curl_init();  
        curl_setopt($ch, CURLOPT_POST, 1);  
        curl_setopt($ch, CURLOPT_URL, $url);  
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);  
        curl_setopt($ch, CURLOPT_HTTPHEADER, array(  
            'Content-Type: application/json; charset=utf-8',  
            'Content-Length: ' . strlen($data_string))  
        );  
        ob_start();  
        curl_exec($ch);  
        $return_content = ob_get_contents();  
        ob_end_clean();  
  
        $return_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);  
        return array($return_code, $return_content);  
    }  

}

?>
